package com.ansuenjob.jsonBuilder;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.ansuenjob.model.Letter;
import com.ansuenjob.model.Resume;
import com.ansuenjob.vo.ApplyJobVo;

public class ApplyJobBuilder extends JSONBuilde {

	@Override
	public ApplyJobVo buildJson(JSONObject jsonObject) throws JSONException {
		ApplyJobVo ajv = new ApplyJobVo();
		JSONArray jresumes = jsonObject.getJSONArray("resumes");
		ajv.setResumes(ResumeFunctions.getResumes(jresumes));
		JSONArray jletters = jsonObject.getJSONArray("letters");
		ajv.setLetters(LetterFunctions.getLetters(jletters));
		return ajv;
	}

}
